import React from "react"
import Sonlife from "./Sonlife"
export default class Perlife extends React.Component {
    constructor () {
        super()
        this.state = {
            msg:'值'
        }
    }
    render () {
        return <div>
            <input type="text" value={this.state.msg} onChange= { (e)=>this.change(e)}/>
            <Sonlife name={this.state.msg} ref="son"></Sonlife>
        </div>
    }
    change = (e)=>{
        this.setState({
            msg:e.target.value
        }, ()=> {
            // console.log(this.refs.son)
            // this.refs.son.name = this.state.msg;
        })
    }
}